from coffeetalk.protocol import ioelement
from coffeetalk.protocol.iotypes import defaulttype

class Credentials(defaulttype.DefaultType):
    
    _type = '[Credentials]'
    username = ''
    password = ''
    group = ''
    ip = ''
    def __init__(self,name=None,username='',password='',group='',ip='',**kwargs):
        defaulttype.DefaultType.__init__(self,name=name)
        self.username = username
        self.password = password
        self.group = group
        self.ip = ip
        
    def _to_element(self):
        return ioelement.IOElement(self.name,{'type':self._type,'username':self.username,'password':self.password,'group':self.group,'ip':self.ip})

    